/* Copyright (c) 2006, 2009, Carl Burch. License information is located in the
 * com.cburch.logisim.Main source code and at www.cburch.com/logisim/. */
 
package com.cburch.logisim.std.arith;

import java.util.List;

import com.cburch.logisim.tools.FactoryDescription;
import com.cburch.logisim.tools.Library;
import com.cburch.logisim.util.Strings;

public class Arithmetic extends Library {
    private static FactoryDescription[] DESCRIPTIONS = {
        new FactoryDescription("Adder", Strings.getter("adderComponent", Strings.stdSource),
                "adder.gif", "Adder"),
        new FactoryDescription("Subtractor", Strings.getter("subtractorComponent", Strings.stdSource),
                "subtractor.gif", "Subtractor"),
        new FactoryDescription("Multiplier", Strings.getter("multiplierComponent", Strings.stdSource),
                "multiplier.gif", "Multiplier"),
        new FactoryDescription("Divider", Strings.getter("dividerComponent", Strings.stdSource),
                "divider.gif", "Divider"),
        new FactoryDescription("Negator", Strings.getter("negatorComponent", Strings.stdSource),
                "negator.gif", "Negator"),
        new FactoryDescription("Comparator", Strings.getter("comparatorComponent", Strings.stdSource),
                "comparator.gif", "Comparator"),
        new FactoryDescription("Shifter", Strings.getter("shifterComponent", Strings.stdSource),
                "shifter.gif", "Shifter"),
    };
    
    private List tools = null;

    public Arithmetic() { }

    public String getName() { return "Arithmetic"; }

    public String getDisplayName() { return Strings.get("arithmeticLibrary", Strings.stdSource); }

    public List getTools() {
        if(tools == null) {
            tools = FactoryDescription.getTools(Arithmetic.class, DESCRIPTIONS);
        }
        return tools;
    }
}
